using System;
using System.Drawing;

using DesignByContract;

namespace Outcoding.GraphGenerator.Entities {

    public class CategoryLabel {

        #region Private Helper Classes (1)
        private class Constants
        {
            public const PPAlignment DEFAULT_HALIGN_VALUE = PPAlignment.ppAlignCenter;
            public const string DEFAULT_FONT_COLOR = @"#000000";
            public const string DEFAULT_FONT_NAME = "Arial";
            public const int DEFAULT_FONT_SIZE = 10;
            public const bool DEFAULT_FONT_DECORATION_VALUE = false;
            public const bool DEFAULT_VISIBLE_VALUE = true;
        }
        #endregion


        private string mFontName = Constants.DEFAULT_FONT_NAME;

        private int mFontSize = Constants.DEFAULT_FONT_SIZE;

        private bool mIsFontBold = Constants.DEFAULT_FONT_DECORATION_VALUE;
        private bool mIsFontItalic = Constants.DEFAULT_FONT_DECORATION_VALUE;
        private bool mIsFontUnderline = Constants.DEFAULT_FONT_DECORATION_VALUE;

        public CategoryLabel() {
            mBorder = new Border();
            mColor = Util.ColorTranslation(Constants.DEFAULT_FONT_COLOR);
        }
        public string FontName
        {
            get
            {
                return mFontName;
            }
            set
            {
                mFontName = value;
            }
        }

        public int FontSize
        {
            get
            {
                return mFontSize;
            }
            set
            {
                Check.Ensure(value > 0, "Size value cannot be less than zero.", new ArgumentOutOfRangeException());
                mFontSize = value;
            }
        }

        public bool IsFontBold
        {
            get
            {
                return mIsFontBold;
            }
            set
            {
                mIsFontBold = value;
            }
        }

        public bool IsFontItalic
        {
            get
            {
                return mIsFontItalic;
            }
            set
            {
                mIsFontItalic = value;
            }
        }

        public bool IsFontUnderline
        {
            get
            {
                return mIsFontUnderline;
            }
            set
            {
                mIsFontUnderline = value;
            }
        }

        private string mText;
        
        public string Text {
            get {
                return mText;
            }
            set {
                mText = value;
            }
        }

        private Border mBorder;

        public Border Border {
            get { return mBorder; }
            set { mBorder = value; }
        }

        private bool mIsSmooth = false;

        public bool IsSmooth {
            get { return mIsSmooth; }
            set { mIsSmooth = value; }
        }

        private Marker mMarker;

        public Marker Marker {
            get {
                if (mMarker == null)
                    mMarker = new Marker();
                return mMarker; 
            }
            set { mMarker = value; }
        }

        private int? mCellHeight = null;

        public int? CellHeight
        {
            get { return mCellHeight; }
            set { mCellHeight = value; }
        }

        private int? mCellWidth = null;

        public int? CellWidth
        {
            get { return mCellWidth; }
            set { mCellWidth = value; }
        }

        private long mColor;

        public long Color
        {
            get { return mColor; }
            set { mColor = value; }
        }

        private PPAlignment mHorizontalAlignment = Constants.DEFAULT_HALIGN_VALUE;

        public PPAlignment HorizontalAlignment
        {
            get
            {
                return mHorizontalAlignment;
            }
            set
            {
                mHorizontalAlignment = value;
            }
        }
    }
}
